<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller {

	public function action_index()
	{
		//$this->request->forward('guide');
		$arr_tb1 = array(
			array(
				'001',
				'002',
				'003',
				'004',
				'005'
			),
			array(
				'001',
				'002',
				'003',
				'004',
				'005'
			),
			array(
				'001',
				'002',
				'003',
				'004',
				'005'
			),
			array(
				'001',
				'002',
				'003',
				'004',
				'005'
			)
		);
		$this->template->set('table1',$arr_tb1);
		$this->response->body(__TEMPLATE__);
	}
	
	public function action_sample()
	{
		$this->template->set('person', 'akira');
		$this->response->body(__TEMPLATE__);
    }

    public function action_vars()
	{
		$param = $this->request->param();
		$rules = array(
			'@orderId' => array(
				'reqmsg' => ' 订单',
				'datatype' => 'li-0001',
			)
		);
		$validation = new Validation($this->request->param(), $rules);
		$this->valid($validation) and $this->ok();
    }

	public function action_valid(){
		$this->response->body('Hello world!');
		/*$rules = array(
			'@username' => array(
				'reqmsg' => ' 不能为空！',
				'datatype' => 'n-7.2',
			),
			'@password' => array(
				'datatype' => 'n-7',
				'reqmsg' => ' 不能为空！',
			),
			'@password2' => array(
				'datatype' => 'reconfirm',
				'reconfirmfor' => 'password',
			),
			'@testrd' => array(
				'reqmsg' => '不能为空！',
				'datatype' => 'n',
			),
			'@testrd2' => array(
				'datatype' => 'idnumber',
			),
			'@testrd3' => array(
				'datatype' => 'daterange',
			),
			'@testrd4' => array(
				'datatype' => 'magic',
				'magic-pattern' => 'idnumber||email',
			),
		);
		$validation = new Validation($this->request->param(), $rules);
		$this->valid($validation) and $this->ok();*/
	}

} // End Welcome
